package com.zenithmind.disk.feign;

import com.zenithmind.disk.pojo.vo.UsersVO;
import com.zenithmind.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 用户服务远程调用接口
 */
@FeignClient(name = "user-service", path = "/api/zenithMind/user", fallback = UserFeignFallbackImpl.class, contextId = "userFeignClient")
public interface UserFeignClient {

    /**
     * 根据ID获取用户信息
     * Corresponds to GET /api/zenithMind/user/getUserById?userId={userId} in user-service
     */
    @GetMapping("/getUserById")
    Result<UsersVO> getUserById(@RequestParam("userId") String userId);

    /**
     * 更新用户已用存储空间
     * Corresponds to PUT /api/zenithMind/user/updateStorageUsed?userId={userId}&fileSize={fileSize} in user-service
     */
    @PutMapping("/updateStorageUsed")
    Result<Void> updateStorageUsed(@RequestParam("userId") String userId, @RequestParam("fileSize") long fileSize);
} 